package com.itcast.hateoas.demo.order.repository;

import com.itcast.hateoas.demo.order.entity.OrderEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;


import java.util.List;

@RepositoryRestResource(path = "/order")
public interface OrderRepository extends JpaRepository<OrderEntity,Long> {

    //根据用户查询订单信息
    List<OrderEntity> findByUser(@Param("user") Long userId);
}
